package a10_StreamIO;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author quan
 * @Description TODO
 * @Date 2023/5/24 16:27
 */
public class a03_FileOutPutStream {
    public static void main(String[] args) throws IOException {
        //1、先创建一个File对象
        File file = new File("D:/hello.txt");
        //2、根据File对象创建一个输出流
        FileOutputStream outputStream = new FileOutputStream(file);
        //3、向文件中写入数据
        outputStream.write(100);
        outputStream.write(101);
        outputStream.write(102);
        //3、刷新缓冲区
        outputStream.flush();
        //4、关闭流
        outputStream.close();
    }
}
